package com.cn.bukeManage.controller;


import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.cn.bukeManage.pojo.Territory;
import com.cn.bukeManage.service.TaskManageService;

//这是任务管理
@Controller
@RequestMapping("/taskManage")
public class TaskManageController {
	@Resource
	private TaskManageService taskManageService;
	//测量订单
	@RequestMapping("/measure")
	public String measure(Model model){
		model.addAttribute("oneMenu", "taskManage");
		model.addAttribute("twoMenu","measure");
		return "taskManage/measure";
	}

	//维修
	@RequestMapping("/repair")
	public String repair(Model model){
		model.addAttribute("oneMenu", "taskManage");
		model.addAttribute("twoMenu","repair");
		return "taskManage/repair";
	}
	//安装
	@RequestMapping("/install")
	public String install(Model model){
		model.addAttribute("oneMenu", "taskManage");
		model.addAttribute("twoMenu","install");
		return "taskManage/install";
	}
	//制作
	@RequestMapping("/make")
	public String make(Model model){
		model.addAttribute("oneMenu", "taskManage");
		model.addAttribute("twoMenu","make");
		return "taskManage/make";
	}
	
	//下维修订单
	@RequestMapping("/toAddRepairIndent")
	@ResponseBody
	public Integer toAddRepairIndent(String name,String phone,String subscribeTime,String weiXbody,Integer Province,Integer City,Integer Village,String address,Double indentPrice){
		Integer integer=taskManageService.toAddRepairIndent(name,phone,subscribeTime,weiXbody,Province,City,Village,address,indentPrice);
		return integer;
	}
	//下测量
	@RequestMapping("/toAddMeasureIndent")
	@ResponseBody
	public Integer toAddMeasureIndent(String name,String phone,String subscribeTime,Integer roomNumB,Integer Province,Integer City,Integer Village,String address,Double addPrice,Double indentPrice){
		Integer integer=taskManageService.toAddMeasureIndent(name,phone,subscribeTime,roomNumB,Province,City,Village,address,addPrice,indentPrice);
		return integer;
	}
	//根据code得到它的省市测量费计算规则
	@RequestMapping("getTerritoryByCode")
	@ResponseBody
	public Territory getCountMoneyByCode(Integer province,Integer city){
		Territory double1=taskManageService.getTerritoryByCode(province,city);
		return double1;
	}
}
